<template>
<div>
  <p>请选择你喜欢的专栏</p>
  <div class="hz" v-for="(obj,index) in arr">
    <input type="checkbox" v-model="inp" @click="addFn(index)" :value="obj"><span>{{obj}}</span>
  </div>
  <ul>
    <li v-for="obj in arr1">{{obj}}</li>
  </ul>
</div>
</template>

<script>
export default {
  data(){
    return {
      arr:["科幻", "喜剧", "动漫", "冒险", "科技", "军事", "娱乐", "奇闻"],
      inp:[],
      arr1:[]
    }
  },
  methods: {
    addFn(index){
      // console.log(index);
      // console.log(this.arr1);
      // console.log(this.arr[index]);
      this.arr1.push(this.arr[index])
    }
  }
};
</script>

<style>
.hz{
  display: inline-block;
}
</style>